// @ts-ignore
/* eslint-disable */
import request from "@/util/request.ts";

/** 此处后端没有提供注释 POST /communityCategory/add */
export async function addCategory(
  body: API.AddCommunityCategoryDTO,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseLong>("/communityCategory/add", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 POST /communityCategory/delete/${param0} */
export async function deleteCategory(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteCategoryParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseBoolean>(
    `/communityCategory/delete/${param0}`,
    {
      method: "POST",
      params: { ...queryParams },
      ...(options || {}),
    }
  );
}

/** 此处后端没有提供注释 GET /communityCategory/list */
export async function listCategories(options?: { [key: string]: any }) {
  return request<API.BaseResponseListCommunityCategory>(
    "/communityCategory/list",
    {
      method: "GET",
      ...(options || {}),
    }
  );
}

/** 此处后端没有提供注释 POST /communityCategory/update */
export async function updateCategory(
  body: API.UpdateCommunityCategoryDTO,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean>("/communityCategory/update", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}
